﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace RFID_EnergyTeam
{
    class CarKitMultiAPI
    {
        public static int LIB_SUCCESS = 0;
        public static int LIB_FAILED = 1;


        /* STS1000(Multi) API */
        // Port Open
        [DllImport("MasterRD.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
        public static extern int rf_init_com(int port, int baud);

        // Port Close
        [DllImport("MasterRD.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
        public static extern int rf_ClosePort();

        // Mode Change
        [DllImport("MasterRD.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
        public static extern int rf_init_type(short icdev, byte type);

        // LED Change
        [DllImport("MasterRD.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
        public static extern int rf_light(short icdev, byte color);

        // Buzzer
        [DllImport("MasterRD.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
        public static extern int rf_beep(short icdev, byte msec);


        /* [1] ISO15693 API */
        // Read UID(Single)
        [DllImport("MasterRD.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
        public static extern int ISO15693_Inventory(short icdev, ref byte pData, ref byte pLen);
    }
}
